home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / ScreenResolution / ui.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  2.4 KB  |  47 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import gettext
  5.  
  6. class AbstractUI:
  7.     '''Abstract user interface.
  8.  
  9.     This encapsulates the entire program logic and all strings, but does not
  10.     implement any concrete user interface.
  11.     '''
  12.     
  13.     def __init__(self):
  14.         '''
  15.         Initialize system.
  16.         '''
  17.         self.gettext_domain = 'screen-resolution-extra'
  18.         gettext.textdomain(self.gettext_domain)
  19.         self.init_strings()
  20.  
  21.     
  22.     def _(self, str, convert_keybindings = False):
  23.         """Keyboard accelerator aware gettext() wrapper.
  24.         
  25.         This optionally converts keyboard accelerators to the appropriate
  26.         format for the frontend.
  27.  
  28.         All strings in the source code should use the '_' prefix for key
  29.         accelerators (like in GTK). For inserting a real '_', use '__'.
  30.         """
  31.         result = unicode(gettext.gettext(str), 'UTF-8')
  32.         if convert_keybindings:
  33.             result = self.convert_keybindings(result)
  34.         
  35.         return result
  36.  
  37.     
  38.     def init_strings(self):
  39.         '''Initialize all static strings which are used in UI implementations.'''
  40.         self.string_permission_text = self._('Monitor Resolution Settings has detected that the virtual resolution must be set in your configuration file in order to apply your settings.\n\nWould you like Screen Resolution to set the virtual resolution for you? (Recommended)')
  41.         self.string_dbus_cant_connect = self._('Could not connect to Monitor Resolution Settings DBUS service.')
  42.         self.string_operation_complete = self._('Please log out and log back in again.  You will then be able to use Monitor Resolution Settings to setup your monitors')
  43.         self.string_cant_apply_settings = self._("Monitor Resolution Settings can't apply your settings.")
  44.         self.string_title = self._('Monitor Resolution Settings')
  45.  
  46.  
  47.